<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script type="text/javascript" src="${ctx}/js/echarts/echarts.min.js"></script>
<div class="col-md-12">
    <div class="alert alert-warning alert-block">
        <table>
            <tr>
                <td align="center" colspan="2"><h1>油画管理系统</h1></td>
            </tr>
        </table>
    </div>
    <%--<p style="padding: 0 10px 10px 10px;height: 50px;line-height: 30px;color: #444;font-size: 30px;text-align: left;background: #fff;margin: 0 10px;">
        订单信息</p>

    <div class="layui-row layui-col-space15" style="margin: 0;">
        <div class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-header">
                    日销量
                </div>
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-sm12">
                            <div id="month_data" style="height: 300px;"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row layui-col-space15" style="margin: 0;">
        <div class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-header">
                    月销量
                </div>
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-sm12">
                            <div id="year_data" style="height: 300px;"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row layui-col-space15" style="margin-top: 20px;">
        <div class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-sm12">
                            <div id="goodscircal" style="height: 300px;width: 48%;float: left;"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row layui-col-space15" style="margin-top: 20px;">
        <div class="layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-sm12">
                            <div id="typecircal" style="height: 300px;width: 48%;float: left;"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>--%>
<script>
    $(function () {
        /*// 基于准备好的dom，初始化echarts实例
        var monthChart = echarts.init(document.getElementById('month_data'));

        // 基于准备好的dom，初始化echarts实例
        var yearChart = echarts.init(document.getElementById('year_data'));

        var goodscircal = echarts.init(document.getElementById('goodscircal'));

        var typecircal = echarts.init(document.getElementById('typecircal'));


        var data = CommnUtil.ajax("${ctx}/dsg/home/selectYearData.shtml", {}, "json");
        if (data.code == 200) {

            var option = {
                title: {
                    text: ''
                },
                tooltip: {},
                legend: {
                    data: ['交易金额']
                },
                grid: {
                },
                xAxis: {
                    type : 'category',
                    data: data.yearMonthDayArr,
                    name: '日期',
                    axisLabel: {
                        rotate: 50,
                        padding: [0, 0, 0, 0],
                        margin: 5,
                    }
                },
                yAxis: {
                    name: '金额'
                },
                series: [{
                    name: '交易額',
                    type: 'bar',
                    data: data.homeYearMonthMoneyYd,
                    barWidth: '25px',
                }]
            };
            monthChart.setOption(option);
            // 指定图表的配置项和数据
            var option = {
                title: {
                    text: ''
                },
                tooltip: {},
                legend: {
                    data: ['交易金额']
                },
                xAxis: {
                    data: data.yearMonthArr,
                    name: '月交易',
                },
                yAxis: {
                    name: '金额'
                },
                series: [{
                    name: '交易金额',
                    type: 'bar',
                    data: data.homeMonthMoney,
                    barWidth: '25px',
                }]
            };
            yearChart.setOption(option);
            debugger;
        var option1 = {
            backgroundColor: 'white',
            title: {
                text: '各产品销量分析',
                left: 'left',
                top: 10,
                textStyle: {
                    color: '#ccc'
                }
            },
            series : [
                {
                    name:'各产品销量分析',
                    type:'pie',
                    clockwise:'true',
                    startAngle:'0',
                    radius : '70%',
                    center: ['50%', '50%'],
                    data:data.newMoneyGoods,
                }
            ]
        };
        goodscircal.setOption(option1);
        var option1 = {
            backgroundColor: 'white',
            title: {
                text: '产品类别销量分析',
                left: 'right',
                top: 10,
                textStyle: {
                    color: '#ccc'
                }
            },
            series : [
                {
                    name:'产品类别销量分析',
                    type:'pie',
                    clockwise:'true',
                    startAngle:'0',
                    radius : '70%',
                    center: ['50%', '50%'],
                    data:data.newMoneyTypes,
                }
            ]
        };
        typecircal.setOption(option1);
        };
    });*/
</script>